/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.chalmers.AV_2DPlatformerMyGame.Model;

import edu.chalmers.AV_2DPlatformerFramework.Model.GameObject;
import edu.chalmers.AV_2DPlatformerFramework.Model.AnimatedTexture;
import edu.chalmers.AV_2DPlatformerFramework.Model.Hitbox;
import edu.chalmers.AV_2DPlatformerFramework.Utility.Vector2D;
import edu.chalmers.AV_2DPlatformerFramework.Utility.Utility;
import java.awt.geom.Rectangle2D;

/**
 *
 * @author Richard
 */
public class Object_MathDude extends GameObject{
    
    private final AnimatedTexture at;
    
    public Object_MathDude(){
        super(null);
        
        Vector2D[] vertices = {
            new Vector2D(15,15), new Vector2D(50,0), new Vector2D(90,40), new Vector2D(85,75),
            new Vector2D(60,80), new Vector2D(90, 200), new Vector2D(5, 200), new Vector2D(30, 80),
            new Vector2D(0, 50), new Vector2D(5, 20)
        };
        try {
            this.setHitbox(new Hitbox(vertices));
        } catch (Hitbox.HitboxMalformedException ex) {
            System.out.println("EXAMPLE_AnimatedExample hitbox malformed");
        }
        setVelocity(new Vector2D(1,1));
        at = new AnimatedTexture(Utility.buildTextureArray(".\\src\\main\\java\\Textures\\animated_example\\", new Rectangle2D.Double()), 10);
        addTexture(at);
    }

    @Override
    public GameObject copy() {
        Object_MathDude copy = new Object_MathDude();
        copy.TEXTURES.clear(); //Needed, as at variable is added in constructor.
        this.copyVariablesTo(copy);
        return copy;
    }

    @Override
    public void onCollision(GameObject otherObject) {
//        System.out.println("animated dude!");
    }
    
}
